Node

public interface Node implements EventTarget, SearchContext

A base DOM object providing access to the common DOM object properties and methods to manage the DOM node structure.

Inheritors

Functions

Link copied to clipboard
public abstract void addEventListener(EventType eventType, Observer<Event> listener, boolean useCapture)
Adds the given listener to the event target.
Link copied to clipboard
public abstract boolean appendChild(Node childNode)
Adds the given node as a child of the current node to the end of its children list.
Link copied to clipboard
public abstract List<Node> children()
Returns an immutable list of all children of this node.
Link copied to clipboard
public abstract void click()
Simulates a click on the node.
Link copied to clipboard
public abstract void close()
Closes this node.
Link copied to clipboard
public abstract Set<DocumentPosition> compareDocumentPosition(Node otherNode)
Compares position of the current node against another node in a DOM tree.
Link copied to clipboard
public abstract boolean dispatch(Event event)
Dispatches the given event at the current event target.
Link copied to clipboard
public abstract Document document()
Returns the Document instance of this node.
Link copied to clipboard
public abstract XPathResult evaluate(String expression)
Evaluates the given XPath expression for the node and returns the XPathResult of the ANY type.
public abstract XPathResult evaluate(String expression, XPathResultType type)
Evaluates the given XPath expression for the node and returns the XPathResult object of the given type.
Link copied to clipboard
public abstract List<Observer<Event>> eventListeners(EventType eventType, boolean useCapture)
Returns the immutable list of event listeners that listen events of the given eventType in a phase that corresponds the given useCapture.
Link copied to clipboard
public abstract Optional<Element> findElementByClassName(String className)
Returns the first Element object found in the current search context by the given className.
Link copied to clipboard
public abstract Optional<Element> findElementByCssSelector(String cssSelector)
Returns the first Element object found in the current search context by the given cssSelector.
Link copied to clipboard
public abstract Optional<Element> findElementById(String id)
Returns the first Element object found in the current search context by the given id.
Link copied to clipboard
public abstract Optional<Element> findElementByName(String name)
Returns the first Element object found in the current search context by the given name.
Link copied to clipboard
public abstract Optional<Element> findElementByTagName(String tagName)
Returns the first Element object found in the current search context by the given tagName.
Link copied to clipboard
public abstract List<Element> findElementsByClassName(String className)
Returns an immutable list of the Element objects found in the current search context by the given className.
Link copied to clipboard
public abstract List<Element> findElementsByCssSelector(String cssSelector)
Returns an immutable list of the Element objects found in the current search context by the given cssSelector.
Link copied to clipboard
public abstract List<Element> findElementsById(String id)
Returns an immutable list of the Element objects found in the current search context by the given id.
Link copied to clipboard
public abstract List<Element> findElementsByName(String name)
Returns an immutable list of the Element objects found in the current search context by the given name.
Link copied to clipboard
public abstract List<Element> findElementsByTagName(String tagName)
Returns an immutable list of the Element objects found in the current search context by the given tagName.
Link copied to clipboard
public abstract boolean insertChild(Node node, Node beforeNode)
Inserts the given node before the given beforeNode as a child of the current node.
Link copied to clipboard
public abstract Optional<Node> nextSibling()
Returns an Optional that contains the next node in the document tree if such a node exists, otherwise returns an empty Optional.
Link copied to clipboard
public abstract String nodeName()
Returns a string that represents the node name in the UTF8 format.
Link copied to clipboard
public abstract String nodeValue()
Returns a string that represents the node value.
public abstract void nodeValue(String value)
Updates the node value with the given new value.
Link copied to clipboard
public abstract Optional<Node> parent()
Returns an Optional that contains the parent of this node.
Link copied to clipboard
public abstract Optional<Node> previousSibling()
Returns an Optional that contains the previous node in the document tree if such a node exists, otherwise returns an empty Optional.
Link copied to clipboard
public abstract boolean removeChild(Node childNode)
Removes the given childNode of the current node from the DOM.
Link copied to clipboard
public abstract void removeEventListener(EventType eventType, Observer<Event> listener, boolean useCapture)
Removes the given listener from the event target.
Link copied to clipboard
public abstract boolean replaceChild(Node newNode, Node oldNode)
Replaces the given child oldNode of the current node with the given newNode.
Link copied to clipboard
public abstract String textContent()
Returns the text content of the current node and its descendants.
public abstract void textContent(String textContent)
Removes all the current node children and replaces them with a single text node with the given textContent.
Link copied to clipboard
public abstract NodeType type()
Returns the node type.
Link copied to clipboard
public abstract String xPath()
Returns a string that represents XPath to the current Node or an empty string if it is not available.